
const { defineConfig } = require('@vue/cli-service')

const path = require('path')
const resolve = function (dir) {
  return path.join(__dirname, dir)
}
module.exports = defineConfig({
  publicPath: './',
  transpileDependencies: true,
  chainWebpack: config => {
    config.resolve.alias
      .set('@', resolve('src'))
      .set('@v', resolve('src/views'))
      .set('@c', resolve('src/components'))
      .set('@u', resolve('src/utils'))
    config.optimization.runtimeChunk('single')
  },
  devServer: {
    proxy: { 
      "/abc": { //url识别符
        target: "https://capi.tianyancha.com", // server地址 https://pm.cnzgc.com
        changOrigin: true, //允许跨域
        pathRewrite: { 
          "^/abc": "",
        },
      },
      "/api": {
        target: "https://srm.cnzgc.com/zjszjj/test", 
        changOrigin: true, //允许跨域
      },
    }, 
    client: {
      overlay: false
    }
  }
})
